package com.jiayang.business.infraredpage;

import com.jiayang.business.infraredpage.domain.dto.PointTemperatureDTO;
import com.jiayang.common.anno.OperateLog;
import com.jiayang.common.domain.ResponseDTO;
import com.jiayang.constant.SwaggerTagConst;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ Author     ：OuyangChenglong
 * @ Date       ：Created in 9:56 2021/9/8
 * @ Description：红外传感器首页
 * @ Modified By：
 * @Version: 1.0$
 */
@RestController
@Api(tags = {SwaggerTagConst.Admin.CLIENT_INFRARED})
@OperateLog
public class InfraredController {

    @Autowired
    private InfraredService infraredService;

    // 红外XY --------------------------------------------------------------------------------------------------------
    @GetMapping("/equipmentInfo/infrared/initGetThermalImaging/{id}")
    @ApiOperation(value = "根据设备id获取设备红外图像", notes = "红外图像 @author OuyangChenglong")
    public ResponseDTO initGetThermalImaging(@PathVariable String id) {
        return infraredService.getThermalImaging(id);
    }

    @PostMapping("/equipmentInfo/infrared/getPointTemperature")
    @ApiOperation(value = "根据前端参数获取点位温度和状态", notes = "点位点击事件 @author OuyangChenglong")
    public ResponseDTO getPointTemperature(@RequestBody PointTemperatureDTO pointTemperatureDTO) {
        return infraredService.getPointTemperature(pointTemperatureDTO);
    }

    @GetMapping("/equipmentInfo/infrared/initGetInfraredState/{id}")
    @ApiOperation(value = "根据设备id获取红外设备状态", notes = "红外设备状态 @author OuyangChenglong")
    public ResponseDTO initGetInfraredState(@PathVariable String id) {
        return infraredService.getInfraredState(id);
    }

}
